import request from '@/utils/request'

// 查询悬赏执行列表
export function listOffer(query) {
  return request({
    url: '/business/offer/list',
    method: 'get',
    params: query
  })
}

// 查询悬赏执行详细
export function getOffer(offerId) {
  return request({
    url: '/business/offer/' + offerId,
    method: 'get'
  })
}

// 新增悬赏执行
export function addOffer(data) {
  return request({
    url: '/business/offer',
    method: 'post',
    data: data
  })
}

// 修改悬赏执行
export function updateOffer(data) {
  return request({
    url: '/business/offer',
    method: 'put',
    data: data
  })
}

// 删除悬赏执行
export function delOffer(offerId) {
  return request({
    url: '/business/offer/' + offerId,
    method: 'delete'
  })
}

// 用户头像上传
export function uploadFile(data) {
  return request({
    url: '/business/offer/uploadFile',
    method: 'post',
    data: data
  })
}